import { ref } from 'vue'
import axios from '../plugins/axios'

export default () => {
   const form = ref<{ title: string }>({ title: '' })
   const searchResList = ref<ArticelModel[]>([])

   const search = async () => {
      const res = await axios.request<ArticelModel[]>({
         url: 'search',
         data: form.value,
         method: 'post'
      })
      searchResList.value = res.data
   }

   return { search, form, searchResList }
}
